<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\modules\admin\models\DataSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('model','Datas');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="data-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('新建', ['create'], ['class' => 'btn btn-success']) ?>
        <?= Html::a('导出', ['all-excel'], ['class' => 'btn btn-primary','data-confirm' => '确定要导出吗？']) ?>
<!--        --><?//= Html::a('打印', ['print'], ['class' => 'btn btn-danger','onclick' => 'window.print()']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'name',
            'title',
            'description:ntext',
            'status',
            // 'version',
            // 'create_time',
            // 'is_show',

            [
                'class' => 'yii\grid\ActionColumn',
                'template' => '{view} {update} {delete}'
//                'buttons' => [
//                    'update' => function ($url, $model, $key) {
//                        return Html::a('Update', ['update1','id' => $key]);
//                    },
//                ]
            ],
        ],
    ]); ?>
</div>
